import { createApp } from 'vue'
import App from '@/App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
// svg插件需要配置代码
import 'virtual:svg-icons-register'
// 引入自定义插件对象：注册整个项目全局组件
import GlobalComponents from '@/components'
// 引入全局样式
import '@/styles/index.scss'
import router from '@/router'
import 'uno.css'
import pinia from '@/store'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './permisstion'
//暗黑模式需要的样式
import 'element-plus/theme-chalk/dark/css-vars.css'

const app = createApp(App)
app.use(pinia)
app.use(ElementPlus)
// app.use(ElementPlus, {
//   locale: zhCn,
// })

// 安装自定义插件
app.use(GlobalComponents)
app.use(router)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

import { isHasButton } from '@/directive/has'
isHasButton(app)

// 挂载应用
app.mount('#app')
